home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 6_17.lha / 6_17 / 6_17a12.c < prev    next >
C/C++ Source or Header  |  1993-08-08  |  366b  |  16 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / x += y
  6. include <minmax.h>
  7. ector& vector::operator+=(vector &v1)
  8.  
  9.    int l = min(v1.p->length, p->length);
  10.    float *f = p->f;
  11.    float *f1 = v1.p->f;
  12.    for (int i = 0; i < l; i++, f++, f1++)
  13. *f += *f1;
  14.    return *this;
  15.  
  16.